package com.gzz.orchid.context.application.base.convert;

import com.gzz.orchid.context.application.base.command.FileSaveCmd;
import com.gzz.orchid.context.application.base.pojo.FileDto;
import com.gzz.orchid.context.application.base.pojo.FileVo;
import com.gzz.orchid.context.infrastructure.persistence.entity.base.BaseFilePo;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * @author higmd
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FileConverter {
    FileConverter INSTANCE = Mappers.getMapper(FileConverter.class);


    FileVo mapVo(BaseFilePo po);


    FileDto mapDto(BaseFilePo po);

    void updatePo(@MappingTarget BaseFilePo po, FileSaveCmd cmd);
}
